/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Learning;

import edu.upf.grupE.Entities.Album;
import java.io.StringReader;
import org.exolab.castor.xml.Unmarshaller;

/**
 *
 * @author Madhava Carrillo <madhava at me.com>
 */
public class Marshallcastor {

    /**
     *
     * @param args
     */
    public static void main(String[] args) {
        String albumxml = "<Album><Name>Ugly Mug 2009</Name><Author>Ruben</Author><Date>2009-02-06</Date><TextDescription><Tag ontology=\"\">Concierto</Tag><Tag ontology=\"\">Musica</Tag><Tag ontology=\"\">Mataro</Tag><UserKeywords>Ruben</UserKeywords><UserKeywords>Fiesta</UserKeywords><Description>Fiesta metal en mataro</Description></TextDescription><GeoLocalization><Latitude>41.34</Latitude><Longitude>2.26</Longitude></GeoLocalization><Picture>2</Picture><Picture>7</Picture></Album>";
        Album album = null;
        try {
            album = (Album) Unmarshaller.unmarshal(Album.class, new StringReader(albumxml));
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println(album.getGeoLocalization().getLatitude());
    }
}
